package cn.gameback.supervisionservices.entity;

// 用户表 User

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;

@JsonInclude(JsonInclude.Include.NON_NULL)  // 忽略所有 null 字段
@TableName("user") // 映射到数据库中的表名
public class User {
    @TableId(value = "id", type = IdType.AUTO) // 设置主键自增策略
    private Integer id;

    @TableField("userName")
    private String userName;

    @TableField("password")
    private String password;

    @TableField("nickName")
    private String nickName;

    @TableField("email")
    private String email;

    @TableField("avator")
    private String avator;

    @TableField("phone")
    private String phone;

    @TableField("created_at")
    private java.sql.Timestamp createdAt;

    @TableField("updated_at")
    private java.sql.Timestamp updatedAt;

    @TableField(exist = false)  // 表示该字段不在数据库表中
    private List<String> roleDescriptions;  // 只存储角色描述

    @TableField(exist = false)  // 表示该字段不在数据库表中
    private List<User> leaders;  // 上级用户

    // Getters and Setters

    public List<User> getLeaders() {
        return leaders;
    }

    public void setLeaders(List<User> leader) {
        this.leaders = leader;
    }

    public List<String> getRoleDescriptions() {
        return roleDescriptions;
    }

    public void setRoleDescriptions(List<String> roleDescriptions) {
        this.roleDescriptions = roleDescriptions;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAvator() {
        return avator;
    }

    public void setAvator(String avator) {
        this.avator = avator;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public java.sql.Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(java.sql.Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    public java.sql.Timestamp getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(java.sql.Timestamp updatedAt) {
        this.updatedAt = updatedAt;
    }
}
